package com.gitee.designpattern.singleton.doublecheck;

/**
 * @author ming.yan-1
 * @version V1.0
 * @Title com.gitee.designpattern.singleton.doublecheck
 * @Description
 * @date 2018/8/30  下午6:04
 */
public class Singleton {
    private static Singleton singleton;

    private Singleton(){
    }

    public static Singleton getInstance(){
        if(singleton == null){
            synchronized (Singleton.class){
                if (singleton == null){
                    singleton = new Singleton();
                }
            }
        }
        return singleton;
    }
}
